package com.dimples.dd.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Schema
@Data
@TableName(value = "oauth2_authorization")
public class Oauth2AuthorizationDO {

    @TableId(value = "id", type = IdType.INPUT)
    @Schema(description = "id")
    private String id;

    /**
     * 注册客户端ID
     */
    @TableField(value = "registered_client_id")
    @Schema(description = "注册客户端ID")
    private String registeredClientId;

    /**
     * 用户名
     */
    @TableField(value = "principal_name")
    @Schema(description = "用户名")
    private String principalName;

    /**
     * 授权类型
     */
    @TableField(value = "authorization_grant_type")
    @Schema(description = "授权类型")
    private String authorizationGrantType;

    /**
     * 授权范围
     */
    @TableField(value = "authorized_scopes")
    @Schema(description = "授权范围")
    private String authorizedScopes;

    /**
     * 附加信息
     */
    @TableField(value = "`attributes`")
    @Schema(description = "附加信息")
    private byte[] attributes;

    /**
     * 状态
     */
    @TableField(value = "`state`")
    @Schema(description = "状态")
    private String state;

    /**
     * 授权码
     */
    @TableField(value = "authorization_code_value")
    @Schema(description = "授权码")
    private byte[] authorizationCodeValue;

    /**
     * 授权码发布时间
     */
    @TableField(value = "authorization_code_issued_at")
    @Schema(description = "授权码发布时间")
    private Date authorizationCodeIssuedAt;

    /**
     * 授权码过期时间
     */
    @TableField(value = "authorization_code_expires_at")
    @Schema(description = "授权码过期时间")
    private Date authorizationCodeExpiresAt;

    /**
     * 授权码元数据
     */
    @TableField(value = "authorization_code_metadata")
    @Schema(description = "授权码元数据")
    private byte[] authorizationCodeMetadata;

    /**
     * 访问令牌
     */
    @TableField(value = "access_token_value")
    @Schema(description = "访问令牌")
    private byte[] accessTokenValue;

    /**
     * 访问令牌发布时间
     */
    @TableField(value = "access_token_issued_at")
    @Schema(description = "访问令牌发布时间")
    private Date accessTokenIssuedAt;

    /**
     * 访问令牌过期时间
     */
    @TableField(value = "access_token_expires_at")
    @Schema(description = "访问令牌过期时间")
    private Date accessTokenExpiresAt;

    /**
     * 访问令牌元数据
     */
    @TableField(value = "access_token_metadata")
    @Schema(description = "访问令牌元数据")
    private byte[] accessTokenMetadata;

    /**
     * 访问令牌类型
     */
    @TableField(value = "access_token_type")
    @Schema(description = "访问令牌类型")
    private String accessTokenType;

    /**
     * 访问令牌范围
     */
    @TableField(value = "access_token_scopes")
    @Schema(description = "访问令牌范围")
    private String accessTokenScopes;

    /**
     * OIDC ID令牌
     */
    @TableField(value = "oidc_id_token_value")
    @Schema(description = "OIDC ID令牌")
    private byte[] oidcIdTokenValue;

    /**
     * OIDC ID令牌发布时间
     */
    @TableField(value = "oidc_id_token_issued_at")
    @Schema(description = "OIDC ID令牌发布时间")
    private Date oidcIdTokenIssuedAt;

    /**
     * OIDC ID令牌过期时间
     */
    @TableField(value = "oidc_id_token_expires_at")
    @Schema(description = "OIDC ID令牌过期时间")
    private Date oidcIdTokenExpiresAt;

    /**
     * OIDC ID令牌元数据
     */
    @TableField(value = "oidc_id_token_metadata")
    @Schema(description = "OIDC ID令牌元数据")
    private byte[] oidcIdTokenMetadata;

    /**
     * 刷新令牌
     */
    @TableField(value = "refresh_token_value")
    @Schema(description = "刷新令牌")
    private byte[] refreshTokenValue;

    /**
     * 刷新令牌发布时间
     */
    @TableField(value = "refresh_token_issued_at")
    @Schema(description = "刷新令牌发布时间")
    private Date refreshTokenIssuedAt;

    /**
     * 刷新令牌过期时间
     */
    @TableField(value = "refresh_token_expires_at")
    @Schema(description = "刷新令牌过期时间")
    private Date refreshTokenExpiresAt;

    /**
     * 刷新令牌元数据
     */
    @TableField(value = "refresh_token_metadata")
    @Schema(description = "刷新令牌元数据")
    private byte[] refreshTokenMetadata;

    /**
     * 用户码
     */
    @TableField(value = "user_code_value")
    @Schema(description = "用户码")
    private byte[] userCodeValue;

    /**
     * 用户码发布时间
     */
    @TableField(value = "user_code_issued_at")
    @Schema(description = "用户码发布时间")
    private Date userCodeIssuedAt;

    /**
     * 用户码过期时间
     */
    @TableField(value = "user_code_expires_at")
    @Schema(description = "用户码过期时间")
    private Date userCodeExpiresAt;

    /**
     * 用户码元数据
     */
    @TableField(value = "user_code_metadata")
    @Schema(description = "用户码元数据")
    private byte[] userCodeMetadata;

    /**
     * 设备授权码
     */
    @TableField(value = "device_code_value")
    @Schema(description = "设备授权码")
    private byte[] deviceCodeValue;

    /**
     * 设备授权码发布时间
     */
    @TableField(value = "device_code_issued_at")
    @Schema(description = "设备授权码发布时间")
    private Date deviceCodeIssuedAt;

    /**
     * 设备授权码过期时间
     */
    @TableField(value = "device_code_expires_at")
    @Schema(description = "设备授权码过期时间")
    private Date deviceCodeExpiresAt;

    /**
     * 设备授权码元数据
     */
    @TableField(value = "device_code_metadata")
    @Schema(description = "设备授权码元数据")
    private byte[] deviceCodeMetadata;
}